package com.itheima.pinda.authority.controller.auth;

import com.itheima.pinda.authority.biz.service.auth.ValidateCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * 登录
 *
 * @author zhangjy
 * @date 2023/9/25
 */
@RestController
@RequestMapping(value = "login")
@Api(tags = "登录", value = "LoginController")
public class LoginController {

    @Resource
    private ValidateCodeService validateCodeService;

    @GetMapping(value = "captcha", produces = "image/png")
    @ApiOperation(notes = "获取验证码", value = "获取验证码")
    public void getCaptcha(String key, HttpServletResponse response) {
        validateCodeService.create(key, response);
    }

}
